@isTest
private class AccountSysUtilTest {
    static testMethod void testMethod1() {
        
 		Province__c pro = TestUtils.createProvince();
        insert pro;

        City__c c = TestUtils.createCity();
        c.Province__c = pro.Id;
        insert c;

        District__c d = TestUtils.createDistrict();
        d.City__c = c.Id;
        insert d;

        // 客户
        Account acc = new Account();
        acc.Name = 'test customer';
        acc.Status__c = '审核通过';
        acc.City__c = c.Id;
        acc.Province__c = pro.Id;
        acc.Artificial__c = '法人';
        acc.RecordTypeId = Utils.getRecordTypeIdByDevNameAndObjName('TerminalCustomer', 'Account');
        insert acc;


        NCCustomer__c  ncc = new NCCustomer__c();
        ncc.Customer__c = acc.Id;
        ncc.DutyParagraph__c = '123';
        ncc.AmountRegisteredCapital__c = 100;
        ncc.OperationMode__c = '批发';
        ncc.UnitProperty__c = '有限责任公司';
        ncc.SPaddress__c = '收票地址';
        ncc.Telephone__c = '开票客户';
        ncc.Contacts__c = '开票联系人';
        ncc.ReceiptAddress__c ='收货地址';
        ncc.ReceivingPhone__c = '1344567';
        ncc.Consignee__c = 'sss';
        ncc.BankAccount__c = '555555555';
        ncc.BankName__c = '中国工商银行';
        ncc.AccountName__c = 'xx';
        ncc.DepositBank__c = '开户银行';
        ncc.AccountName__c = '帐户名称';

        ncc.TermValidity__c = System.today();
        ncc.ValidityBusinessLicense__c = System.today();
        ncc.ApprovalStatus__c = '审批通过';

        insert ncc;

        AccountSysUtil.addCustbase(ncc.Id);
        AccountSysUtil.addMedCustDoc(ncc.Id);



    }

    static testMethod void testMethod2() {

    		Province__c pro = TestUtils.createProvince();
        insert pro;

        City__c c = TestUtils.createCity();
        c.Province__c = pro.Id;
        insert c;

        District__c d = TestUtils.createDistrict();
        d.City__c = c.Id;
        insert d;

        Account dacc = new Account();
        dacc.Name = 'test dealer ';
        dacc.Status__c = '审核通过';
        dacc.RecordTypeId = Utils.getRecordTypeIdByDevNameAndObjName('Dealer', 'Account');

        insert dacc;

        // 客户
        Account acc = new Account();
        acc.Name = 'test customer';
        acc.Status__c = '审核通过';
        acc.City__c = c.Id;
        acc.Province__c = pro.Id;
        acc.Artificial__c = '法人';
        acc.RecordTypeId = Utils.getRecordTypeIdByDevNameAndObjName('TerminalCustomer', 'Account');
        insert acc;

    		MajorUserInfo__c mj = new MajorUserInfo__c();
    		mj.MajorCustomer__c = acc.Id;
    		mj.Dealer__c = dacc.Id;
    		insert mj;
        AccountSysUtil.majorAddCustbase(mj.Id);


    }
}